//
//  TestAppDelegateService.swift
//  Test
//
//  Created by Louis Liu on 06/02/2018.
//  Copyright © 2018 Louis Liu. All rights reserved.
//


import Foundation
import PluggableApplicationDelegate
import JLRoutes
import SFFundation

@objc final class TestAppDelegateService: NSObject, ApplicationService {

    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
        
        print("注册工程内Service")
        //注册字体
        UIFont.registerFontWithFilenameString(filenameString: "sixfoot.ttf", bundle: Bundle.main)
        registerRouter()
        return true
    }
    
    func registerRouter(){
//        JLRoutes.global().addRoute(ComponentRouter.ShowTrackDetail.path) { (data) -> Bool in
//            guard let trackID = data["trackID"] as? String else { return false }
//            let storyboard = UIStoryboard.init(name: "TrackDetial", bundle: Bundle.main)
//            
//            let trackView = storyboard.instantiateViewController(withIdentifier: "TrackDetailViewController") as! TrackDetailViewController
//            trackView.trackID = trackID
//            trackView.hidesBottomBarWhenPushed = true
//            MainWindow?.currentViewController()?.navigationController?.pushViewController(trackView, animated: true)
//            return true
//        }
    }
    
    func applicationDidEnterBackground(_ application: UIApplication) {
        print("It has entered background")
    }
}

